﻿

#region Using Statements

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Threading;
using System.ComponentModel;
using System.Reflection;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Design;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

using Freeform;
using FGame = Freeform.Game;
using XGame = Microsoft.Xna.Framework.Game;
using FComponent = Freeform.Component;

#endregion


namespace Freeform
{
    /// <summary>
    /// Represents an Entity that exists in a 3D world.
    /// </summary>
    public class Entity3D : Entity, IGeometric3D
    {

        #region Members

        /// <summary>
        /// Gets the 3D actor for this entity.
        /// </summary>
        public Actor3D Actor { get; internal set; }


        /// <summary>
        /// Gets or sets the position of the entity.
        /// </summary>
        public Vector3 Position { get; set; }


        /// <summary>
        /// Gets or sets the orientation of the entity.
        /// </summary>
        public Vector3 Orientation { get; set; }


        /// <summary>
        /// Gets or sets the size of the entity.
        /// </summary>
        public Vector3 Size { get; set; }

        #endregion


        #region Init

        /// <summary>
        /// Creates a new entity and automatically links it to the given world.
        /// </summary>
        /// <param name="World">The world that this entity belongs to.</param>
        public Entity3D(World World) 
            : base(World)
        {
            Position = Vector3.Zero;
            Size = Vector3.One;
            Orientation = Vector3.Zero;
        }

        #endregion


        #region Update


        #endregion


        #region Draw

        /// <summary>
        /// Allows the entity to draw itself.
        /// </summary>
        /// <param name="Time">Provides a snapshot of timing values.</param>
        /// <param name="Viewport">The viewport to render to.</param>
        public override void Draw(GameTime Time, Viewport Viewport)
        {
            if (Actor == null) return;

            Viewport3D View = Viewport as Viewport3D;
            if (View == null) return;

            Actor.Draw(View, Time);
        }

        #endregion


        #region Dispose


        #endregion


        #region Utility


        #endregion

    }
}